package org.healer.simple_juc;

public class TestDaemon {

    public static void main(String[] args) {
        God god =new God();
        You you = new You();
        Thread thread = new Thread(god);
        thread.setDaemon(true);//false是用户线程，正常的都是用户线程

        thread.start();
        new Thread(you).start();
    }
}
class You implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 36500; i++) {
            System.out.println("快快乐乐的活每一天天");
        }
        System.out.println("======GoodBey World=====");
    }
}
class God implements Runnable{

    @Override
    public void run() {
        while(true)
            System.out.println("上帝保佑着你！！！");
    }
}
